from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class ServerIP(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    ip_address = db.Column(db.String(15), nullable=False)
    server_type = db.Column(db.String(50))
    status = db.Column(db.Boolean, default=False)
    arch = db.Column(db.String(100))
    os = db.Column(db.String(100))
    compiler = db.Column(db.String(100))
    kernel = db.Column(db.String(100))
    location = db.Column(db.String(100))
    number = db.Column(db.String(100))
    last_updated = db.Column(db.DateTime, default=db.func.now())
    note = db.Column(db.String(100))

    def __repr__(self):
        return f'<Server {self.ip_address}>'

